def is_correct_bracket(text):
    while '()' in text:
        text = text.replace('()', '')
    if text == '':
        return True
    return False

    while '{}' in text:
        text = text.replace('{}', '')
    if text == '':
        return True
    return False

    while '[]' in text:
        text = text.replace('[]', '')
    if text == '':
        return True
    return False
txt=input()
print(is_correct_bracket(txt))
